from model import Perceptron
from data_generator import data_generator
from parameters import learning_rate, epochs
from train import train
from draw import draw
import torch
import warnings
warnings.filterwarnings("ignore")


def runner():
    net = Perceptron()
    loader, data_x, data_y = data_generator()
    optimizer = torch.optim.SGD(net.parameters(), lr=learning_rate)
    loss_func = torch.nn.MSELoss()
    train(net, loader, loss_func, optimizer, epochs)
    draw(net, data_x, data_y)

if __name__ == '__main__':
    runner()
